#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int cnt[300];
int n;

int main()
{
	int t;
	cin >> t;
	//cout << "2^8" << "  " << pow(2, 8) << endl;
	while (t--) {
		cin >> n;
		memset(cnt, 0, sizeof(cnt));
		int ans = 0;
		int sum = 0;
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
			a[i] ^= a[i - 1];
			ans = max(ans, a[i]);
		}
		cnt[0] = 1;
		for (int i = 1; i <= n; i++) {
			for (int j = 0; j < (1 << 8); j++) {
				if (cnt[j]) {
					ans = max(ans, a[i] ^ j);
				}
			}
			cnt[a[i]] = 1;
		}
		cout << ans << endl;
	}
	return 0;
}